package com.qdevelop.control.action;

import java.util.Map;

import com.qdevelop.control.bean.QueryBean;
import com.qdevelop.model.utils.UtilsFactory;

@SuppressWarnings("serial")
public class EditPasswordAction extends QDevelopBaseAction{
	int cn;
	String oldPass,newPass;

	@SuppressWarnings("unchecked")
	public String execute() throws Exception{
		if(oldPass!=null&&newPass!=null&&newPass.length()>0&&oldPass.length()>0){
			Map param = this.getParamMap();
			param.put("oldPass", UtilsFactory.stringUtils().get64MD5(oldPass));
			param.put("newPass", UtilsFactory.stringUtils().get64MD5(newPass));
			QueryBean qb = UtilsFactory.qdevelopUtils().getQueryBean(param);
			cn = UtilsFactory.dbUtils().updateBySQL(qb);
		}
		return SUCCESS;
	}
	public int getCn() {
		return cn;
	}
	public void setCn(int cn) {
		this.cn = cn;
	}
	public String getOldPass() {
		return oldPass;
	}
	public void setOldPass(String oldPass) {
		this.oldPass = oldPass;
	}
	public String getNewPass() {
		return newPass;
	}
	public void setNewPass(String newPass) {
		this.newPass = newPass;
	}

}
